/** Email Validate */
function isEmail(email) {
	var reg = /^[0-9a-zA-Z_\.\-]+@[0-9a-zA-Z_\-]+(\.[0-9a-zA-Z_\-]+)+$/;
	return reg.test(email);
}

/** Number Validate */
function isNumber(number) {
	var reg = /^[0-9]+$/;
	return reg.test(number);
}
/** mobile phone validate */
function isMobileNumber(value) {
	var reg = /^[1][0-9]{10}$/;
	return reg.test(value);
}

/** 字串实际长度，其中一个汉字占两个字符 */
function getStrCharLen(s) {
	var i, str1, str2, str3, nLen;
	str1 = s;
	nLen = 0;

	for (i = 1; i <= str1.length; i++) {
		str2 = str1.substring(i - 1, i)
		str3 = escape(str2);
		if (str3.length > 3) {
			nLen = nLen + 2;
		} else {
			nLen = nLen + 1;
		}
	}
	return nLen;
}

/** 简化拼装字符串 自定义StringBuffer */
function StringBuffer() {
	this.string = new Array();
	this.append = function(string) {
		this.string.push(string);
	}
	this.toString = function() {
		return this.string.join("");
	}
}

/**将按下的enter键转为tab键*/
function enterToTab(){
	if(event.keyCode==13){
		event.keyCode=9;
	}
}